package cn.edu.ctbu.secdata.service;


import cn.edu.ctbu.secdata.domain.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface IStudentService {

    public List<Student> getAll();

    public Page<Student> getAll(Pageable pageable);

    public List<Student> getAll(Example<Student> example);

    /**
     * 通过姓名来查询对应的学生列表
     * @return 指定姓名的学生列表
     */

    public List<Student> findByName(String studentName);

    public List<Student> findByNameLike(String studentName);

    public Student findById(Integer id);

    public List<Student> getStudentScoreLess(Integer score);

    /**
     * 新增和更新单个学生
     * @param student
     * @return
     */
    public Student save(Student student);

    public void delete(Integer id);

    public void delete(Student student);

    /**
     * 支持分页的找出所有学生
     * @param pageable
     * @return
     */
    public Page<Student> findAll(Pageable pageable);

    /**
     * 按性别查询，并分页
     * @param sex
     * @param pageable
     * @return
     */
    public Page<Student> findBySex(Integer sex,Pageable pageable);


    public Student validUserNameAndPassword(String userName,String password) throws Exception;

}
